package checker;

public class SingleChecker extends Checker{
	private String[] origin_string;
	private String[] compared_string;
	private int copy_count;
	public SingleChecker()
	{
		this.origin_string = null;
		this.compared_string = null;
		this.copy_count = 0;
	}
	public void set_origin_stringarray(String[] origin)
	{
		this.origin_string = origin;
	}
	public void set_compared_stringarray(String[] compared)
	{
		this.compared_string = compared;
	}
	public void compare()
	{
		int origin_length = origin_string.length;
		int compared_length = compared_string.length;
		for(int i = 0; i < origin_length ; i ++)
		{
			String origin = origin_string[i];
			for(int j = 0; j < compared_length ; j++)
			{
				String compared = compared_string[j];
				if(origin.equals(compared))
				{
					this.copy_count++;
				}
			}
		}
	}
	public int getCount()
	{
		return this.copy_count;
	}
}
